package com.example.demo.readController;

import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.FileInputStream;
import java.io.IOException;

@RestController
public class ReadTest2 {
    @GetMapping("2")
    public void read() throws IOException {

        FileInputStream fis=new FileInputStream("D:\\莱西有利数据\\1\\莱西有礼数据导出\\储值卡账户信息.xls");

        HSSFWorkbook workbook = new HSSFWorkbook(fis);
            //获取工作薄
            //获取工作表
           // XSSFSheet sheetAt = workbook.getSheetAt(0);
        HSSFSheet sheetAt = workbook.getSheetAt(0);



        for (Row cells : sheetAt) {
                Cell cell = cells.getCell(8);
                System.out.println(cell);
            }
            workbook.close();

        }


}
